package com.weight.system.sysoper.service.impl;

import com.weight.system.sysoper.PO.SysOperInfo;
import com.weight.system.sysoper.service.SysOperInfoService;
import com.weight.system.sysoper.DAO.SysOperInfoMapper;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import org.springframework.transaction.annotation.Transactional;
import com.weight.common.util.CommonUtils;
import lombok.extern.slf4j.Slf4j;

/**
 * 账号信息表
 */
@Service
@Transactional
@Slf4j
public class SysOperInfoServiceImpl implements SysOperInfoService {

	@Autowired
	private SysOperInfoMapper sysOperInfoMapper;


	/**
	 * 查询账号信息信息--条件查询
	 * @param map
	 * @return
	 */
	@Override
	public List<SysOperInfo> findSysOperInfoByT(Map map){
		return sysOperInfoMapper.findSysOperInfoByT(map);
	}

	/**
	 * 查询账号信息信息--条件，分页查询
	 * @param currentPage
	 * @param pageSize
	 * @param map
	 * @return
	 */
	@Override
	public List<SysOperInfo> findSysOperInfoByPage(int currentPage,int pageSize,Map map){
		PageHelper.startPage(currentPage, pageSize);
		List<SysOperInfo> sysOperInfoList = sysOperInfoMapper.findSysOperInfoByT(map);
		return sysOperInfoList;
	}

	/**
	 * 查询账号信息信息--查询全部
	 * @return
	 */
	@Override
	public List<SysOperInfo> findAll(){
		return sysOperInfoMapper.findAll();
	}

	/**
	 * ID查询账号信息信息
	 * @param map
	 * @return
	 */
	@Override
	public SysOperInfo findBySysOperInfoId(Map map){
		SysOperInfo sysOperInfo=sysOperInfoMapper.findBySysOperInfoId(map);
		CommonUtils.validateExistObj(sysOperInfo,map);
		return sysOperInfo;
	}

	/**
	 * ID查询账号信息信息-批量
	 * @param sysOperInfoIdList
	 * @return
	 */
	@Override
	public List findBySysOperInfoIdList(List sysOperInfoIdList){
		List idList = sysOperInfoMapper.findBySysOperInfoIdList(sysOperInfoIdList);
		CommonUtils.validateExistList(idList,sysOperInfoIdList);
		return idList;
	}

	/**
	 * 添加账号信息
	 * @param sysOperInfo
	 */
	@Override
	public void insertSysOperInfo(SysOperInfo sysOperInfo){
		sysOperInfoMapper.insertSysOperInfo(sysOperInfo);
	}

	/**
	 * 批量添加账号信息
	 * @param sysOperInfoList
	 */
	@Override
	public void insertSysOperInfoBatch(List<SysOperInfo> sysOperInfoList){
		sysOperInfoMapper.insertSysOperInfoBatch(sysOperInfoList);
	}

	/**
	 * 修改账号信息
	 * @param sysOperInfo
	 */
	@Override
	public void updateSysOperInfo(SysOperInfo sysOperInfo){
		sysOperInfoMapper.updateSysOperInfo(sysOperInfo);
	}

	/**
	 * 修改账号信息
	 * @param sysOperInfo
	 */
	@Override
	public void updateSysOperInfoLimt(SysOperInfo sysOperInfo){
		sysOperInfoMapper.updateSysOperInfoLimt(sysOperInfo);
	}

	/**
	 * 物理删除账号信息
	 * @param map
	 */
	@Override
	public void deleteBySysOperInfoId(Map map){
		sysOperInfoMapper.deleteBySysOperInfoId(map);
	}

	/**
	 * 批量物理删除账号信息
	 * @param sysOperInfoIdList
	 */
	@Override
	public void deleteBySysOperInfoIdBatch(List sysOperInfoIdList){
		sysOperInfoMapper.deleteBySysOperInfoIdBatch(sysOperInfoIdList);
	}

	/**
	 * 状态删除账号信息
	 * @param map
	 */
	@Override
	public void upDelBySysOperInfoId(Map map){
		sysOperInfoMapper.upDelBySysOperInfoId(map);
	}

	/**
	 * 批量状态删除账号信息
	 * @param sysOperInfoList
	 */
	@Override
	public void upDelBySysOperInfoIdBatch(Map<String, Object> map){
		sysOperInfoMapper.upDelBySysOperInfoIdBatch(map);
	}

}